

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>${Inter.printOut('Create schedule',session.language)}</title>
    </head>
    <body>
        <div class="undernav">
          <span class="menuButton"><g:link action="show" id="${courseid}" controller="course">${Inter.printOut('Back to Course',session.language)}</g:link></span>
        </div>
        <div class="body">
            <h1>${Inter.printOut('Create schedule for the course:',session.language)} ${Course.get(courseid).name}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${scheduleInstance}">
            <div class="errors">
                <g:renderErrors bean="${scheduleInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <input type="hidden" name="course.id" value="${courseid}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="start">${Inter.printOut('Start Date',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:scheduleInstance,field:'start','errors')}">
                                    <g:datePicker name="start" value="${scheduleInstance?.start}" precision="minute" ></g:datePicker>
                                </td>
                            </tr> 
                            <tr>
                                <td valign="top" class="name">
                                    <label for="end">${Inter.printOut('End Date',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:scheduleInstance,field:'end','errors')}">
                                    <g:datePicker name="end" value="${scheduleInstance?.end}" precision="minute" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="location">${Inter.printOut('Location',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:scheduleInstance,field:'location','errors')}">
                                  <input type="text" id="location" maxlength="20" name="location" value="${fieldValue(bean:scheduleInstance,field:'location')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="seats">${Inter.printOut('Seats',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:scheduleInstance,field:'seats','errors')}">
                                    <input type="text" id="seats" name="seats" value="${fieldValue(bean:scheduleInstance,field:'seats')}" />
                                </td>
                            </tr> 

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="seats">${Inter.printOut('Teacher responsible',session.language)}:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:scheduleInstance,field:'responsible','errors')}">
                                    <g:select optionKey="id" from="${Course.get(courseid).getListOfEmployees()}" noSelection="['null':'']" name="responsible.id" value="${scheduleInstance?.responsible?.id}" ></g:select>
                                </td>
                            </tr>

                        

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="${Inter.printOut('Create',session.language)}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
